package com.xunai.saas.example.controller;

import com.xunai.saas.example.model.param.AddTongueRecordParam;
import com.xunai.saas.example.model.param.CorporeityDiagnoseHandleParam;
import com.xunai.saas.example.model.param.CorporeityDiagnoseStartParam;
import com.xunai.saas.example.service.CorporeityDiagnoseService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 智能体质检测示例接口
 *
 * @author Admin
 */
@RequestMapping("/corporeityDiagnoseApi")
@RestController
public class CorporeityDiagnoseApiExample {

    @Resource
    CorporeityDiagnoseService corporeityDiagnoseService;

    /***
     * 开始诊断
     * @param corporeityDiagnoseStartParam
     * @return
     */
    @PostMapping("/start")
    public String start(@RequestBody CorporeityDiagnoseStartParam corporeityDiagnoseStartParam) {
        return corporeityDiagnoseService.start(corporeityDiagnoseStartParam);
    }

    /***
     * 问题回答
     * @param corporeityDiagnoseHandleParam
     * @return
     */
    @PostMapping("/handle")
    public String handle(@RequestBody CorporeityDiagnoseHandleParam corporeityDiagnoseHandleParam) {

        return corporeityDiagnoseService.handle(corporeityDiagnoseHandleParam);
    }

    /***
     * 添加舌诊记录
     * @param addTongueRecordParam
     * @return
     */
    @PostMapping("/addTongueRecord")
    public String addTongueRecord(@RequestBody AddTongueRecordParam addTongueRecordParam) {

        return corporeityDiagnoseService.addTongueRecord(addTongueRecordParam);
    }

    /***
     * 获取结果
     * @param recordNo
     * @return
     */
    @GetMapping("/result")
    public String result(@RequestParam("recordNo") String recordNo) {
        return corporeityDiagnoseService.result(recordNo);
    }
}
